Next | Prev | Up | Top | Contents | Index

Enabling Debugging in irix.sm

In order to make debugging symbols available in the kernel, you must make two changes, one required and one optional, in the file /var/sysgen/system/irix.sm. As superuser, make a hard link to the file /var/sysgen/system/irix.sm as irix.sm.nondebug. This enables you to return easily to a nondebugging kernel.


Including Symbols in the Kernel Image

Edit /var/sysgen/system/irix.sm. Near the end, note the lines that resemble the following:

* Compilation and load flags
*   To load a kernel that can be co-resident with symmon
*   (for breakpoint debugging) replace LDOPTS
*   with the following.  You must also INCLUDE prf and idbg.
*
*LDOPTS: -non_shared -N -e start -G 8 -elf -woff 84 -woff 47 -woff 17 -mips2 -o32  -nostdlib  -T 88069000   
The active LDOPTS statement (the one without an initial asterisk) appears a few lines later. Remove the asterisk from the front of the debugging LDOPTS to make it active. Insert an asterisk to convert the original LDOPTS into a comment.


Including idbg in the Kernel Image

The symbol-display routines used by the command-line kernel display tool, idbg, are contained in optional kernel modules. (See "Using idbg".) You can change /var/sysgen/system/irix.sm so that support for idbg is always present in the kernel. Alternatively, you can load these modules manually with ml before you use them (see the ml(1) reference page).

If you are entering an extended debugging period, make the modules permanent. Look for the lines in /var/sysgen/system/irix.sm that resemble the following:

*
* Kernel debugging tools (see profiler(1M) and idbg(1M))
*
EXCLUDE: idbg
EXCLUDE: dmiidbg, grioidbg, xfsidbg, xlvidbg, cachefsidbg
USE : prf
Change these lines, if necessary, so that both idbg and prf are marked USE, not EXCLUDE. Verify that the file /var/sysgen/boot/idbg.o exists. It is normally installed with the debugging kernel feature.

Parts of the idbg support that are unique to particular filesystems are in the other modules listed in this area of irix.sm. Modules such as xlvidbg are useful to Silicon Graphics developers but are not likely to be helpful to developers of third-party drivers. However, it does no harm to change those modules from EXCLUDE to USE also.


Including Lock Metering in the Kernel Image

In addition to the display support included by the idbg modules, you can include a module that supports lock metering. This module keeps statistics on the use of of each semaphore, basic lock, and reader/writer lock, and displays the statistics through idbg commands. To enable this facility, locate the lines in /var/sysgen/system/irix.sm that resemble the following:

* Required kernel modules
...
* ksync - kernel synchronization routines (mutex_lock, sv_wait, psema...)
*   or
*   ksync_metered  - metered kernel synchronization routines
...
*
KERNEL: kernel
INCLUDE: os, disp, mem, zero
INCLUDE: ksync
EXCLUDE: ksync_metered
Reverse the state of the two "ksync" lines so that ksync is excluded and ksync_metered is included.


Next | Prev | Up | Top | Contents | Index